Skip to content

Add LogExpectedImprovementPerCost acquisition function#3304

Open
wgst wants to merge 2 commits into
meta-pytorch:mainfrom
wgst:feature/log-expected-improvement-with-cost
Open

Add LogExpectedImprovementPerCost acquisition function#3304
wgst wants to merge 2 commits into
meta-pytorch:mainfrom
wgst:feature/log-expected-improvement-with-cost

Conversation

@wgst
Copy link
Copy Markdown

@wgst wgst commented May 8, 2026

Hi all,

I'm working on implementation for BO termination conditions methods in BoFire, and to implement one of them (by Xie et al., arXiv:2507.12453, 2025), we need this cost-aware logEI acquisition function (logEIC).

logEIC is analytic single-outcome acquisition function computing LogEI(x) - alpha * log(c(x)), supporting spatially varying costs.

Motivation

Cost-aware Bayesian optimization is important when function evaluations have heterogeneous costs (e.g. reaction time, compute budget, experimental reagent cost). This PR adds LogExpectedImprovementPerCost to botorch_community, which computes:

$$\text{logEIC}(x) = \text{logEI}(x; x^*) - \alpha \cdot \log c(x)$$

where $c(x)$ is a user-supplied cost callable and $\alpha$ controls the cost influence.

Have you read the Contributing Guidelines on pull requests?

Yes.

Test Plan

Unit tests are added in test_community/acquisition/test_log_expected_improvement_per_cost.py.

Copilot AI review requested due to automatic review settings May 8, 2026 17:29
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented May 8, 2026

Hi @wgst!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new cost-aware analytic acquisition function to botorch_community implementing log expected improvement per (spatially varying) evaluation cost, intended to support cost-aware stopping / selection rules.

Changes:

  • Introduces LogExpectedImprovementPerCost (analytic) computing LogEI(x) - alpha * log(c(x)).
  • Adds unit tests covering constant cost, varying alpha, maximize/minimize, and batch shapes.
  • Exports the new acquisition function from botorch_community.acquisition.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
botorch_community/acquisition/log_expected_improvement_per_cost.py New analytic acquisition function implementing cost-adjusted LogEI.
test_community/acquisition/test_log_expected_improvement_per_cost.py New unit tests validating behavior against LogExpectedImprovement.
botorch_community/acquisition/__init__.py Re-exports LogExpectedImprovementPerCost in the community acquisition package.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread botorch_community/acquisition/log_expected_improvement_per_cost.py
Comment thread test_community/acquisition/test_log_expected_improvement_per_cost.py Outdated
Comment thread test_community/acquisition/test_log_expected_improvement_per_cost.py Outdated
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented May 8, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 8, 2026
@wgst wgst closed this May 13, 2026
@wgst wgst reopened this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants